﻿package com.hnev.gui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Welcome extends JFrame{
	JPanel panel;//中间容器
	JLabel lblwelcome;
	JButton btIn;
	public Welcome(){
		setSize(600,600);//尺寸
		setLocation(400, 80);//位置
		setVisible(true);//可见性
		setTitle("水果超市欢迎界面");
		setDefaultCloseOperation(Welcome.EXIT_ON_CLOSE);
		
			panel = new JPanel(null);
		lblwelcome=new JLabel("欢迎进入水果系统~");
		lblwelcome.setBounds(180,100,600,200);
		int size=24;
		lblwelcome.setFont(new Font("Serif",Font.PLAIN,size));
		this.add(panel);
		panel.add(lblwelcome);
		btIn = new JButton("进入系统");
		
		this.add(panel);
		panel.add(btIn);
	
		btIn.setBounds(180,350,200,60);
		
		this.setVisible(true);
		

	class MyActionListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			
			Object source=e.getSource();
			if(source.equals(btIn)){
				new Login();
				setVisible(false);
				
				
				
			
			}
		
		}
	}

	MyActionListener listener = new MyActionListener();
	btIn.addActionListener(listener);
	btIn.addActionListener(new ActionListener() {
		
		@Override
		public void actionPerformed(ActionEvent e) {
			
			
		}
	});
  }

	
	

	public static void main(String[] args) {
		new Welcome();
	}
}